#!/usr/bin/env python
# coding: utf-8

# In[1]:


#折线图
import matplotlib.pyplot as plt
# plt.figure(figsize=(20, 10), dpi=100)
emo = ['2x','4x','6x','8x','12x','14x','16x']
Bicubic = [88.14, 84.81, 79.76, 76.47, 70.24, 66.49, 62.71]
Basis = [87.14, 83.81,78.76, 75.47, 69.24, 66.00, 62.11]
Ours = [88.72, 86.15, 82.01, 79.07, 70.21, 67.55, 63.91]
plt.plot(emo, Bicubic, c='#404D5B', linestyle='--', marker="*", markersize=10, linewidth =2.0,label="Bicubic")
plt.plot(emo, Basis, c='#549263', linestyle='--', marker="o", linewidth =2.0, markersize=8, label="Basis")
plt.plot(emo, Ours, c='#99B86B', linestyle='--', marker="^", linewidth =2.0,markersize=8, label="Ours")
# plt.plot(emo, Bicubic, c='royalblue', linestyle='-.', marker="*", markersize=10, linewidth =2.0,label="Bicubic")
# plt.plot(emo, Basis, c='red', linestyle='--', marker="o", linewidth =2.0, markersize=8, label="Basis")
# plt.plot(emo, Ours, c='green', linestyle='-', marker="o", linewidth =2.0,markersize=8, label="Ours")
# plt.scatter(emo, Bicubic,c='royalblue',s=50,label="Bicubic")
# plt.scatter(emo, Basis,c='green',s=80,label="Basis")
# plt.scatter(emo, Ours,c='blue',s=90,label="Ours")
plt.legend(loc='best')
# plt.yticks(range(80, 90, 1))
plt.grid(True, linestyle='-.', alpha=0.5)
plt.xlabel("Scale of resolution degradation", fontdict={'size': 10})
plt.ylabel("Recognition Accuracy", fontdict={'size': 10})
plt.title("RAFDB", fontdict={'size': 10})
# plt.show()


# #折线图
# import matplotlib.pyplot as plt
# # plt.figure(figsize=(20, 10), dpi=100)
# listemo = ['Baseline', 'KFER', 'IFER', 'Joint Learning']
# x_list = [0,1,2,3]
# RAFDB = [84.30,85.33,86.18,87.48]
# FERPlus = [82.31,83.47,84.82,85.47]
# s1 = [i*12 for i in RAFDB]
# s2 = [i*12 for i in FERPlus]
# # (50*np.random.rand(20))**2
# # plt.plot(listemo, RAFDB, c='royalblue', linestyle=' ',linewidth =2.0,label="Low-light RAFDB")
# # plt.plot(listemo, FERPlus, c='lightgreen', linestyle=' ',linewidth =2.0,label="Low-light FERPlus")

# line1 = plt.scatter(listemo, RAFDB,c='cornflowerblue',s=s1)
# line2 = plt.scatter(listemo, FERPlus,c='lightgreen',s=s2)

# for a, b in zip(x_list, RAFDB):
#     plt.text(a, b - 0.13, '%.2f' % b, ha='center', va='bottom', fontsize=8)

# for a, b in zip(x_list, FERPlus):
#     plt.text(a, b - 0.13, '%.2f' % b, ha='center', va='bottom', fontsize=8)

# # 
# #--------------
# fig, ax = plt.subplots(figsize = (7,3), dpi = 200)
# # --- Remove spines and add gridlines
# ax.spines["left"].set_visible(False)
# ax.spines["top"].set_visible(False)
# ax.spines["right"].set_visible(False)
# ax.grid(ls = "--", lw = 0.5, color = "#4E616C")

# --- The data
# ax.plot(X_, Y_for, marker = "o")
# ax.plot(X_, Y_ag, marker = "o")

#---------------


# plt.legend(loc='best')
# plt.yticks(range(0, 50, 5))
# plt.grid(True, linestyle='--', alpha=0.5)
# plt.xlabel("listemo", fontdict={'size': 16})
# plt.ylabel("Recognition Accuracy", fontdict={'size': 12})
# plt.title("", fontdict={'size': 20})
# plt.legend(handles=[line1, line2], labels=['Low-light RAFDB','Low-light FERPlus'],ncol=1,loc="best",markerscale=0.35)   # 给出图例
# 去除两轴白边
# plt.gca().xaxis.set_major_locator(plt.NullLocator())
# plt.gca().yaxis.set_major_locator(plt.NullLocator())
# plt.subplots_adjust(top = 1, bottom = 0, right = 1, left = 0, hspace = 0, wspace = 0)
# plt.margins(0,0)
# plt.savefig('./ms_acc.png', dpi=300, bbox_inches='tight')  # 保存图片
plt.show()